import axios from 'axios';

const prefix = '/api/like';

export function likeBlog(blogId, userId) {
  return axios.post(`${prefix}/like.do`, { blog_id: blogId, user_id: userId });
}

export function unlikeBlog(blogId, userId) {
  return axios.post(`${prefix}/unlike.do`, { blog_id: blogId, user_id: userId });
}

export function isLiked(blogId, userId) {
  return axios.get(`${prefix}/isLiked.do`, { params: { blog_id: blogId, user_id: userId } });
}

export function getLikeCount(blogId) {
  return axios.get(`${prefix}/likeCount.do`, { params: { blog_id: blogId } });
} 